package com.cn.wanxi.thread;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

public class TestTime {
    public static void main(String[] args) {
        Timer timer = new Timer();
        Date date = new Date();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        try {
            date = simpleDateFormat.parse("2020-11-23 15:11:00");
        } catch (ParseException e) {
            e.printStackTrace();
        }
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                sendString("aa");

            }
        }, date);
//
//        timer.cancel();
    }

    private static void sendString(String aa) {
        System.out.println(aa);
    }
}
